//
//  HongguoCollectionViewCell.m
//  GOGOTravel
//
//  Created by dllo on 16/2/29.
//  Copyright © 2016年 果果. All rights reserved.
//

#import "HongguoCollectionViewCell.h"

@implementation HongguoCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageView1 = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageView1];
        [_imageView1 release];
        
   
        
        self.alphaView = [[UIView alloc] init];
        [self.contentView addSubview:_alphaView];
        [_alphaView release];
        
        
        
        self.labelName = [[UILabel alloc] init];
        [self.contentView addSubview:_labelName];
        [_labelName release];
        
        self.labelNum = [[UILabel alloc] init];
        [self.contentView addSubview:_labelNum];
        [_labelNum release];
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    _imageView1.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width, layoutAttributes.frame.size.height);
    
    _imageView1.layer.cornerRadius = 10;
    _imageView1.layer.masksToBounds = YES;
    
    
    _alphaView.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width, layoutAttributes.frame.size.height);
    _alphaView.backgroundColor = [UIColor blackColor];
    _alphaView.alpha = 0.4;
    
    _alphaView.layer.cornerRadius = 10;
    _alphaView.layer.masksToBounds = YES;
    
    
    
    _labelName.frame = CGRectMake(10, layoutAttributes.frame.size.height - 60,layoutAttributes.frame.size.height - 30, 40);
    _labelName.backgroundColor = [UIColor clearColor];
    _labelName.textColor = [UIColor whiteColor];
    _labelName.font = [UIFont boldSystemFontOfSize:19];
    _labelNum.frame = CGRectMake(20, layoutAttributes.frame.size.height - 20, 70, 10);
    _labelNum.font = [UIFont systemFontOfSize:14];
}

- (void)dealloc{
    [_imageView1 release];
    [super dealloc];
}

@end
